-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api-minor] Add "contentLength" to the information returned by the getMetadata
method
#12642
[api-minor] Add "contentLength" to the information returned by the getMetadata
method
#12642
Conversation
/botio unittest |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/5af3c78a0e5e0d9/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/b5cea25373b65e7/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/b5cea25373b65e7/output.txt Total script time: 3.75 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/5af3c78a0e5e0d9/output.txt Total script time: 4.90 mins
|
…etMetadata` method Given that we already include the "Content-Disposition"-header filename, when it exists, it shouldn't hurt to also include the information from the "Content-Length"-header. For PDF documents opened via a URL, which should be a very common way for the PDF.js library to be used, this will[1] thus provide a way of getting the PDF filesize without having to wait for the `getDownloadInfo`-promise to resolve[2]. With these API improvements, we can also simplify the filesize handling in the `PDFDocumentProperties` class. --- [1] Assuming that the server is correctly configured, of course. [2] Since that's not *guaranteed* to happen in general, with e.g. `disableAutoFetch = true` set.
a983061
to
01d12b4
Compare
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/1490a8901c487df/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/1490a8901c487df/output.txt Total script time: 4.24 mins Published |
Nice work! |
Given that we already include the "Content-Disposition"-header filename, when it exists, it shouldn't hurt to also include the information from the "Content-Length"-header.
For PDF documents opened via a URL, which should be a very common way for the PDF.js library to be used, this will[1] thus provide a way of getting the PDF filesize without having to wait for the
getDownloadInfo
-promise to resolve[2].With these API improvements, we can also simplify the filesize handling in the
PDFDocumentProperties
class.Smaller/simpler diff with https://github.com/mozilla/pdf.js/pull/12642/files?w=1
[1] Assuming that the server is correctly configured, of course.
[2] Since that's not guaranteed to happen in general, with e.g.
disableAutoFetch = true
set.